package sourceread;

import org.junit.Test;

import java.util.HashMap;

/**
 * @author zhuqiang
 */
public class HashMapDemo {
    public static void main(String[] args) {
        HashMap<String,String> map = new HashMap<>();
        System.out.println(map.put("1", "1"));
        System.out.println(map.put("2", "1"));
        System.out.println(map.put("3", "1"));
        System.out.println(map.put("4", "1"));
        System.out.println(map.put("5", "1"));
        System.out.println(map.put("6", "1"));
        System.out.println(map.put("7", "1"));
        System.out.println(map.put("8", "1"));
        System.out.println(map.put("9", "1"));
        System.out.println(map.put("10", "1")); // 桶坐标重复
        System.out.println(map.put("11", "1"));
        System.out.println(map.put("12", "1"));
        System.out.println(map.put("13", "1"));
        System.out.println(map.put("14", "1")); //进行扩容
        System.out.println(map.put("15", "1"));
        System.out.println(map.put("16", "1"));
        System.out.println(map.put("16", "2")); // 覆盖值的话，会返回被覆盖的值
        System.out.println(map.put(null, "1"));

  /*      map.get("1");
        map.remove("10");
        map.remove("1");*/
        map.entrySet();
    }
    @Test
    public void introduction(){
        HashMap<String,String> map = new HashMap<>();
        map.put("1","1");
        map.put("2","1");
        map.put("3","1");
        map.put("4","1");
        map.put("5","1");
        map.put("6","1");
        map.put("7","1");
        map.put("8","1");
        map.put("9","1");
        map.put("10","1");
        map.put(null,"1");
        map.put(null,"1");
    }

}
